//商品路由
import express from "express";
const router = express.Router()

//导入控制层
import goods from "../controller/goods";

//获取商品分类数
router.get("/api/category",goods.goodsCategory);
//模糊搜索(商品名称)
router.post("/api/searchgoods",goods.goodsSearchgoods);
//获取推荐商品列表
router.get("/api/recommendshoplist",goods.goodsreCommendshoplist);
//获取所有商品
router.get("/api/allgoods",goods.goodsAllgoods);
//获取首页商品列表
router.get("/api/homeshoplist",goods.goodsHomeshoplist);
//获取商品详细信息
router.get("/api/goodsdetail",goods.goodsdetail);
//获取商品评价
router.get("/api/goodscomment",goods.goodscomment);
//评论商品
router.post("/api/postcomment",goods.postcomment);
//添加商品到购物车
router.post("/api/add_shop_cart",goods.addShopCart);
//查询购物车的商品
router.get("/api/cart_goods",goods.cartGoods);
//删除购物车单条商品
router.post("/api/delete_goods",goods.deleteGoods);
//修改商品数量 
router.post("/api/change_goods_count",goods.changeGoodsCount);
//删除recommend单条商品
router.post("/api/delete_recom_goods",goods.deleteRecomGoods);
//修改recommend商品信息
router.post("/api/update_recom_goods",goods.updateRecomGoods);
//添加商品到recommend
router.post("/api/add_shop_recom",goods.addShopRecom);
//删除所有商品
router.post("/api/delete_all_goods",goods.deleteAllGoods);

//导出模块
export default router;